home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / xgui / sources / ui_layer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-25  |  2.9 KB  |  129 lines

  1. /*****************************************************************************
  2.   FILE           : ui_layer.c
  3.   SHORTNAME      : layer.c
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : popups a window with all layers. It is possible to choose layers
  7.                    and to alter layer names as well.
  8.   NOTES          : is called only during initialisation
  9.  
  10.   AUTHOR         : Tilman Sommer
  11.   DATE           : 31.8.1990
  12.  
  13.   CHANGED BY     :
  14.   IDENTIFICATION : @(#)ui_layer.c    1.9 3/2/94
  15.   SCCS VERSION   : 1.9
  16.   LAST CHANGE    : 3/2/94
  17.  
  18.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  19.  
  20. ******************************************************************************/
  21.  
  22.  
  23. #include <stdio.h>
  24.  
  25. #include "ui.h"
  26.  
  27. #include <X11/Xaw/Form.h>
  28. #include <X11/Xaw/Command.h>
  29. #include <X11/Xaw/Box.h>
  30. #include <X11/Xaw/AsciiText.h>
  31. #include <X11/Xaw/Label.h>
  32. #include <X11/Xaw/Cardinals.h>
  33.  
  34. #include "ui_xWidgets.h"
  35.  
  36. #include "ui_layerP.h"
  37.  
  38. #include "ui_layer.ph"
  39.  
  40.  
  41.  
  42. /*****************************************************************************
  43.   FUNCTION : ui_xCreateLayerPanel
  44.  
  45.   PURPOSE  : create the panel
  46.   RETURNS  : void
  47.   NOTES    : the wigdet will be created in relative position to eachother
  48.  
  49.   UPDATE   :
  50. *****************************************************************************/
  51.  
  52. void ui_xCreateLayerPanel (Widget parent)
  53.  
  54. {
  55.  
  56.     /* tabs for data fields and small buttons */
  57.  
  58.     Widget      oldLabel, nameLabel, nrLabel, label;
  59.  
  60.     int    i;
  61.     char   buf[80];
  62.     int    flagWord = ui_layerStartValue;
  63.     int    bit = 1;
  64.     
  65.     int  fontWidth = 8;
  66.  
  67.     int  labelWidth  =  9 * fontWidth;
  68.     int  nameWidth   = 25 * fontWidth;  
  69.  
  70.  
  71.  
  72. /***************************************************************************/
  73.  
  74.     ui_layerPanel = 
  75.     XtCreateManagedWidget("lPanel", formWidgetClass, parent, NULL, ZERO);
  76.  
  77.  
  78. /*****************************  HEAD LINE  *********************************/
  79.  
  80.     nrLabel =
  81.     ui_xCreateLabelItem("layer", ui_layerPanel, labelWidth,  
  82.                 NULL, NULL);
  83.     ui_xSetResize(nrLabel, TRUE);
  84.  
  85.     label = nrLabel;
  86.  
  87.     nameLabel =
  88.     ui_xCreateLabelItem("name", ui_layerPanel, nameWidth,  
  89.                 nrLabel, NULL);
  90.  
  91. /*****************************  LINES  *************************************/
  92.  
  93.     for (i=0; i<MAX_NO_LAYERS; i++) {
  94.  
  95.     oldLabel = label;
  96.     sprintf(buf,"%2d",i+1);
  97.     label = 
  98.         ui_xCreateLabelItem(buf, ui_layerPanel, labelWidth, NULL, label); 
  99.     ui_xSetResize(label, TRUE);
  100.  
  101.     ui_layerNameWidgets[i] =
  102.         ui_xCreateDialogItem("layerName", ui_layerPanel, 
  103.                  &ui_layerNames[i][0], nameWidth, 
  104.                  nrLabel, oldLabel);
  105.  
  106.     ui_layerButtonWidgets[i] =
  107.         ui_xCreateToggleItem("on", ui_layerPanel, NULL, 
  108.                  ui_layerNameWidgets[i], oldLabel);
  109.     ui_xSetToggleState(ui_layerButtonWidgets[i], 
  110.                ui_utilIsSet(flagWord, bit));
  111.     bit *= 2;
  112.     }
  113.  
  114. /***************************************************************************/
  115.  
  116.     XawFormDoLayout(ui_layerPanel, True);
  117. }
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. /* end of file */
  128. /* lines: 132 */
  129.